<?php
/**
 * Created by PhpStorm.
 * User: dayu
 * Date: 2019/12/19
 * Time: 15:54
 */

namespace app\api\controller;


use think\Controller;
use think\cache\driver\Redis as thinkRedis;
use think\Request;

class BaseController extends Controller
{

    protected $user_id;
    protected $shop_id;
    protected $openid;
    protected $redis;

    public function __construct()
    {
        $userInfo = (new thinkRedis())->get(request()->header("access-token"));
        $this->user_id = $userInfo['user_id'];
        $this->shop_id = $userInfo['shop_id'];
        $this->openid = $userInfo['openid'];
        $this->redis = new \Redis();
        $this->redis->connect('127.0.0.1', 6379);
    }


}